package com.example.yls.demoa;

import android.animation.ValueAnimator;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {
/*private MyView myView;*/
private CircleProgressView circleProgressView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

     circleProgressView=findViewById(R.id.circleView);

     ValueAnimator valueAnimator=ValueAnimator.ofInt(0,88);
     valueAnimator.setDuration(5000);
     valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
         @Override
         public void onAnimationUpdate(ValueAnimator valueAnimator) {
             int center= (int) valueAnimator.getAnimatedValue();
             circleProgressView.setProgress(center);
         }
     });

        /*   myView=findViewById(R.id.my_view);


        ValueAnimator valueAnimator=ValueAnimator.ofInt(0,500);
    valueAnimator.setDuration(5000);
    valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator valueAnimator) {
            int center= (int) valueAnimator.getAnimatedValue();
            myView.setCenter(center);
        }
    });
    valueAnimator.start();*/
        valueAnimator.start();


    }
}
